package com.twu.biblioteca;

import java.util.ArrayList;

public class movieCatalogBuilder {
    private movieInstance movieObject;
    private ArrayList<movieInstance> listOfMovies;

    public movieCatalogBuilder(){
        listOfMovies = new ArrayList<movieInstance>(15);
    }
    public void addMovie(movieInstance movieToAdd){
        listOfMovies.add(movieToAdd);
    }
    public void viewMovieList(){
        System.out.printf("%-50s  %-20s", "Movie Name", "Year Of Release");
        System.out.printf("%50s  %20s%n","Name of Director", "Rating");
        int count;
        movieInstance currentMovie;
        for(count = 0; count< listOfMovies.size(); count++){
            currentMovie = listOfMovies.get(count);
            System.out.printf("%-50s  %-20s" ,currentMovie.getMovieName(), currentMovie.getYearOfRelease());
            System.out.printf("%50s  %20s%n" ,currentMovie.getDirectorName(), currentMovie.getMovieRating());
        }
    }
}
